<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<title>培训质量测评</title>

<!-- Bootstrap -->
<link href="${pageContext.request.contextPath}/portal/project/classquestionnaire/bp/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/portal/project/classquestionnaire/css/style.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
      <script src="js/html5shiv.min.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<!--app content-->
<div class="titleBar"> 教学质量评估 </div>
<%-- <c:if test="${empty resultLis.resultList}"> --%>
<c:if test="${fn:length(resultList) ne 0}">
<div class="classInfo">
    <div class="classInfoTitle">班级评估</div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="classInfo">
        <c:forEach var="info" items="${resultList }">
					<tr><th>	<c:out value="${info.questionnaireName }" /></th></tr>
					<tr><td>主办单位：${info.sponsorName}</td></tr>
					<tr><td>评估状态：
							<c:if test="${info.assessmentState==1}">未开始</c:if>
							<c:if test="${info.assessmentState==2}">正在评估</c:if>
							<c:if test="${info.assessmentState==3}">已评估</c:if>
							<c:if test="${info.assessmentState==4}">已过期</c:if>
					</td></tr>
					<tr><td><a href="#" class="btn" onclick="openQuestion('${info.questionnaireId}','${searchClassId }','${info.testCondition}','${info.assessmentState}','${sessionScope.userInfo.userId }','scan')">
					<c:if test="${info.testCondition==2}">查看</c:if>
					<c:if test="${info.testCondition==1}">评估</c:if>
					</a></td></tr>
				</c:forEach>
    </table>
</div>
</c:if>
<c:if test="${fn:length(List) ne 0}">
<div class="classInfo">
    <div class="classInfoTitle">课程评估</div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="classInfo">
   		 <c:forEach var="courseinfo" items="${List }">
		   		 <tr> <th colspan="2">${courseinfo.courseName}</th></tr>
		   		 <tr>
			            <td>主讲教师：${courseinfo.speaker}</td>
        		</tr>
		   		 <tr>
			           <td>评估状态：<c:if test="${courseinfo.assessmentState==1}">未开始</c:if>
									<c:if test="${courseinfo.assessmentState==2}">正在评估</c:if>
									<c:if test="${courseinfo.assessmentState==3}">已评估</c:if>
									<c:if test="${courseinfo.assessmentState==4}">已过期</c:if>
			            </td>
        		</tr>
				<tr><td colspan="2"><a href="#" class="btn" onclick="openQuestion('${courseinfo.questionnaireId}','${courseinfo.courseId}','${courseinfo.testCondition}','${courseinfo.assessmentState}','${sessionScope.userInfo.userId }','con')">
				<c:if test="${courseinfo.testCondition==2}">查看</c:if>
				<c:if test="${courseinfo.testCondition==1}">评估</c:if>
				</a></td></tr>
				</c:forEach>
</div>
</c:if>
<!--app content end--> 

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> 
<script src="${pageContext.request.contextPath}/portal/project/classquestionnaire/js/jquery.min.js"></script> 
<!-- Include all compiled plugins (below), or include individual files as needed --> 
<script src="${pageContext.request.contextPath}/portal/project/classquestionnaire/bp/js/bootstrap.min.js"></script>
<script>
	if ("${resultState.state}" == 200) {
		alert("${resultState.message}");
	}
	function openQuestion(id, classId, testCondition,flag,userId,met) {
		if(1==flag){
			alert("该问卷还未开始！");
			return;
		}else if(2==flag||3==flag){
		if (testCondition == 1) {
			location.href = "${pageContext.request.contextPath}/module/userquestionnaire/preOpenQuestionnairePaper.do?searchQuestionnaireId="
					+ id + "&searchClassId=" + classId+"&searchUserId="+userId+"&method="+met;
			} else {
				location.href = "${pageContext.request.contextPath}/module/userquestionnaire/checkUserQuestionnaireInfo.do?searchQuestionnaireId="
						+ id + "&searchClassId=" + classId+"&searchUserId="+userId+"&method="+met;
			}
		}else{
			alert("该问卷已经结束！");
		}
	}
</script>
</body>
</html>